package com.darwin.darwinUI.events
{
	import flash.events.Event;
	/**
	 * UI事件
	 * @author vanCopper
	 * 
	 */	
	public class UIEvent extends Event
	{
		/**
		 *  组件皮肤名字
		 */		
		public var skinName:String;
		
		/**
		 * 皮肤加载完成 
		 */		
		public static const SKIN_COMPLETE:String = "skinComplete";
		
		/**
		 * 列表项单击
		 * data:
		 * 		type:类别
		 * 		date:被单击的列表项所包含的数据
		 */
		public static const LISTITEM_CLICK:String = "listitem_click";
		
		/**
		 * 列表选择索引发生改变
		 */
		public static const LIST_SELECTED_INDEX_CHANGE:String = "list_selected_index_change";
		
		/**
		 * 列表被单击
		 */
		public static const LIST_CLICK:String = "list_click";
		
		/**
		 * listable的setDataSource触发的事件
		 */
		public static const LIST_DATA_CHANGE:String = "list_data_change";
		
		/**
		 * 列表滚动完成
		 */
		public static const LIST_ROLL_COMP:String = "listRollComp";
		
		/**
		 * 组件改变事件 
		 */		
		public static const UI_CHANGE:String = "uiChange";
		
		public function UIEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false,data:Object = null)
		{
			super(type, bubbles, cancelable);
			_data = data;
		}
		
		private var _data:Object;
		/**
		 * 事件带的数据
		 */
		public function set data(value:Object):void
		{
			_data = value;
		}
		public function get data():Object
		{
			return _data;
		}
		
		override public function clone():Event 
		{
			var ue:UIEvent = new UIEvent(type, bubbles, cancelable);
			ue.data = data;
			return ue;
		}
	}
}